<template>
  <view>
    <!-- 文章内容 -->
    <rich-text :nodes="knowledge_info.content"></rich-text>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        // 文章详情对象
        knowledge_info: {},
        // 跳转携带的id
        arcId: null
      }
    },
    methods: {
      // 获取文章详情
      async getArticleInfo() {
        const {data:res} = await uni.$http.get(`/knowledge/getKnowledgeDetail?knowledgeId=${this.arcId}`)
        console.log(res);
        // 请求成功,转存数据
        this.knowledge_info = res.data
      }
    },
    // 获取跳转携带的参数
    onLoad(options) {
      this.arcId = options.arcId
      this.getArticleInfo()
    },
    onShow() {
    }
  }
</script>

<style lang="scss">
  page {
    background: rgba(245, 246, 250, 1);
  }
</style>
